package utils.IDE;


import javax.swing.*;
import utils.properties.YourJavaPropertiesUtils;

/**
 *
 * @author Juan Carlos García
 */
public class IDESelectorUtils {
    
    
    /**
     * This method is used to select the route of the current IDE
     * 
     * @return void
     */
    public static void select(){
        
        
        JFileChooser workspaceSelector = new JFileChooser("Selecciona el nuevo Workspace");
           
           workspaceSelector.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
         
           int returnVal = JFileChooser.CANCEL_OPTION;
           
           while(returnVal != JFileChooser.APPROVE_OPTION){
               
               returnVal = workspaceSelector.showOpenDialog(null);
               
               String currentIDE = workspaceSelector.getSelectedFile().getAbsolutePath();
               
               YourJavaPropertiesUtils.setProperty("IDE",currentIDE,"properties");
               
               
           }
        
    }
    
}
